<?php
/************************************************************************/
/*                                WEBSHARE                              */
/************************************************************************/
//
// Copyright (c) 2008 by Virginie Vivancos
// http://www.webshare.fr
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// =======================================================================
// Fonction : XSL d'affichage des dossiers en mode détails
// Nom      : details.xsl.php
// Version  : 0.6.5
// Date     : 28/05/08
// =======================================================================
session_start();
header('Content-Type: application/xml');
echo '<'.'?xml version="1.0" encoding="UTF-8"'.'?>';
include_once "../fonctions.php";

?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"
                doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
                doctype-system="declarations.dtd"
    />
<xsl:template match="/" name="document">
<xsl:apply-templates/>
  </xsl:template>


  <xsl:template match="repGalerie">
  <xsl:variable name="commentGlobal" select="commentGlobal"/>
   <xsl:if test='(commentGlobal != "")'>
     <div class="headerDetails">
        <xsl:value-of select='commentGlobal'/>
     </div>
   </xsl:if>
   <div id="headerDetails" class="v3" style="padding:0">

     <span class="caseimg"><u><img width="32" height="18" src="<?php echo $_SESSION["ws"]["cheminImg"]?>vide.<?php echo $_SESSION["ws"]["formatExt"]?>" title=""/></u></span>
     <span class="nom" style="top:2px"><img width="2" height="18" src="<?php echo $_SESSION["ws"]["cheminImg"]?>lh_divider.<?php echo $_SESSION["ws"]["formatExt"]?>" title=""/><b> <?php echo $_SESSION["ws"]["dia"]["name"]?> </b></span>
     <span class="apercucmt" style="top:2px"><img width="2" height="18" src="<?php echo $_SESSION["ws"]["cheminImg"]?>lh_divider.<?php echo $_SESSION["ws"]["formatExt"]?>" title=""/><b> <?php echo $_SESSION["ws"]["dia"]["comment"]?> </b></span>
     <span class="taille" style="top:2px;right:250px"><img width="2" height="18" src="<?php echo $_SESSION["ws"]["cheminImg"]?>lh_divider.<?php echo $_SESSION["ws"]["formatExt"]?>" title=""/> <?php echo $_SESSION["ws"]["dia"]["FileSize"]?> </span>
     <span class="extension" style="top:2px;right:200px"><img width="2" height="18" src="<?php echo $_SESSION["ws"]["cheminImg"]?>lh_divider.<?php echo $_SESSION["ws"]["formatExt"]?>" title=""/> <?php echo $_SESSION["ws"]["dia"]["exttype"]?> </span>
     <span class="datemodif" style="top:2px;right:100px"><img width="2" height="18" src="<?php echo $_SESSION["ws"]["cheminImg"]?>lh_divider.<?php echo $_SESSION["ws"]["formatExt"]?>" title=""/> <?php echo $_SESSION["ws"]["dia"]["DateTimeOriginal"]?> </span>

   </div>
   <ul class='v3' name="dragLayer" id="dragLayer" style="width:99%">
   <xsl:for-each select="ent">

    <xsl:variable name="nom" select="nom"/>
    <xsl:variable name="num" select="num"/>
    <xsl:variable name="lnk" select="lnk"/>
    <xsl:variable name="vis" select="vis"/>
    <xsl:variable name="tai" select="tai"/>
    <xsl:variable name="ext" select="ext"/>
    <xsl:variable name="prm" select="prm"/>
    <xsl:variable name="cmt" select="cmt"/>
    <xsl:variable name="dtm" select="dtm"/>
    <xsl:variable name="pro" select="pro"/>
    <xsl:variable name="web" select="web"/>
    <xsl:if test='(pro = "sup")'>
       <script language="javascript">boutonUp="<xsl:value-of select='lnk'/>";</script>
    </xsl:if>
    <xsl:variable name="action">
      <xsl:choose>
        <xsl:when test='(prm = "R") or (prm = "RW")'>
          initAction("")
        </xsl:when>
      <xsl:otherwise>
        rien()
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>

    <li class='cible' onclick='if (altClick==0) {$action}' onmouseover='this.className="cadre";if ((typeof(chargeContext)!="undefined")&amp;&amp;(attenteClic==false)) chargeContext({$num});' onmouseout='this.className="cible";if ((typeof(chargeContext)!="undefined")&amp;&amp;(attenteClic==false)) chargeContext(0);' style='width:100%'>
    <form name='param{$num}'>
      <input type='hidden' name='num' value="{$num}" />
      <input type='hidden' name='lnk' value="{$lnk}" />
      <input type='hidden' name='nom' value="{$nom}" />
      <input type='hidden' name='ext' value="{$ext}" />
      <input type='hidden' name='tai' value="{$tai}" />
      <input type='hidden' name='prm' value="{$prm}" />
      <input type='hidden' name='pro' value="{$pro}" />
      <input type='hidden' name='dtm' value="{$dtm}" />
      <input type='hidden' name='web' value="{$web}" />
      <input type='hidden' name='srv' value="" />
    </form>

      <span class='caseimg'>
       <u>
         <xsl:if test='(pro!= "url")'>
          <xsl:if test='(ext= "jpg") or  (ext= "jpeg") or  (ext= "gif") or  (ext= "png") or  (ext= "JPG") or  (ext= "JPEG") or  (ext= "GIF") or  (ext= "PNG")'>
          <img src='<?php echo $_SESSION["ws"]["cheminIcn"]?>{vis}' width='32' height='32' title="{$nom}"/>
        </xsl:if>
          <xsl:if test='(ext!="ico") and (ext!="jpg") and (ext!="jpeg") and (ext!="gif") and (ext!="png") and (ext!="JPG") and (ext!="JPEG") and (ext!="GIF") and (ext!="PNG")'>
          <img src='<?php echo $_SESSION["ws"]["cheminIcn"]?>minis/{vis}' width='32' height='32' title="{$nom}"/>
        </xsl:if>
          <xsl:if test='(ext = "ico")'>
            <img src='<?php echo $_SESSION["ws"]["cheminIcn"]?>{vis}' title="{$nom}" style="width:32px;height:32px"/>
         </xsl:if>
      </xsl:if>
      <xsl:if test='(pro= "url")'>
         <img src='<?php echo $_SESSION["ws"]["cheminIcn"]?>minis/{ext}.<?php echo $_SESSION["ws"]["formatExt"]?>' title="{$nom}"/>
      </xsl:if>
       </u>
      </span>

      <span class='nom'>
        <?php if ($navig=="OP") { ?>
          <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>menuContext.<?php echo $_SESSION["ws"]["formatExt"]?>' onclick="reloadContext()" style='margin-right:8px' title="<?php echo $_SESSION["ws"]["dia"]["menuContext"]?>"/>
        <?php } ?>
        <u>
      <xsl:value-of select="nom"/>
            <xsl:if test='(prm = "R") and ("1" = "<?php echo $_SESSION["ws"]["typeUser"]?>")'>
              <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>verrou1.<?php echo $_SESSION["ws"]["formatExt"]?>' title='<?php echo $_SESSION["ws"]["dia"]["readOnly"]?>'/>
            </xsl:if>
        <xsl:if test='(prm = "W")'>
              <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>verrou2.<?php echo $_SESSION["ws"]["formatExt"]?>' title='<?php echo $_SESSION["ws"]["dia"]["writeOnly"]?>'/>
            </xsl:if>
            <xsl:if test='(prm = "N")'>
              <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>verrou3.<?php echo $_SESSION["ws"]["formatExt"]?>' title='<?php echo $_SESSION["ws"]["dia"]["locked"]?>'/>
            </xsl:if>
        </u>
       <xsl:if test='(cmt != "")'>
            <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>infocomment.<?php echo $_SESSION["ws"]["formatExt"]?>' title="{$cmt}" onmouseover="altClick=1;" onmouseout="altClick=0;"  onclick="memoContext();montrerCommentaire(iciLien)"/>
        </xsl:if>
        <xsl:if test='(pro = "url")'>
            <img src='<?php echo $_SESSION["ws"]["cheminImg"]?>infolien.<?php echo $_SESSION["ws"]["formatExt"]?>' title="{$web}"/>
        </xsl:if>
  </span>

    <span class='apercucmt'>
      <xsl:value-of select="substring(cmt,0,50)"/>
    </span>
    <span class='datemodif'>
        <xsl:value-of select="dtm"/>
    </span>

    <span class='extension'>
        <xsl:if test='(pro = "url") and (ext != "url")'>
           <xsl:value-of select="ext"/>
        </xsl:if>
        <xsl:if test='(pro = "url") and (ext = "url")'>
          Url
        </xsl:if>
        <xsl:if test='(pro = "local")'>
          <xsl:value-of select="ext"/>
        </xsl:if>
        <xsl:if test='(pro = "dossier")'>
          <?php echo $_SESSION["ws"]["dia"]["rep"]?>
        </xsl:if>
        <xsl:if test='(pro = "sup")'>
          <?php echo $_SESSION["ws"]["dia"]["niveauSup"]?>
        </xsl:if>

    </span>
    <span class='taille'>
              <xsl:if test="($tai &gt; 0) and ($tai &lt; 1024)">
                <xsl:value-of select="number(tai)"/> <?php echo $_SESSION["ws"]["dia"]["octet"]?>
              </xsl:if>
              <xsl:if test="($tai &gt;= 1024) and ($tai &lt; 1048576)">
                <xsl:value-of select="format-number(number(tai) div number(1024),'#.00')"/> K<?php echo $_SESSION["ws"]["dia"]["octet"]?>
              </xsl:if>
              <xsl:if test="($tai &gt;= 1048576) and ($tai &lt; 1073741824)">
                <xsl:value-of select="format-number(number(tai) div number(1048576),'#.00')"/> M<?php echo $_SESSION["ws"]["dia"]["octet"]?>
              </xsl:if>
              <xsl:if test="($tai &gt;= 1073741824)">
                <xsl:value-of select="format-number(number(tai) div number(1073741824),'#.00')"/> G<?php echo $_SESSION["ws"]["dia"]["octet"]?>
              </xsl:if>
      </span>

    </li>
   </xsl:for-each>
   </ul>
  </xsl:template>

</xsl:stylesheet>
